/*
 * image_feature.h
 *
 *  Created on: Oct 22, 2011
 *      Author: tqlong
 */

#ifndef IMAGE_FEATURE_H_
#define IMAGE_FEATURE_H_

#include <armadillo>
#include <vector>
#include <opencv/cv.h>

class Feature
{
  arma::vec f_;
public:
  Feature () {}
  Feature (const arma::vec& f) : f_(f) {}
  operator const arma::vec& () const { return f_; }
  cv::Point2d point2d() const { return cv::Point2d(f_(0), f_(1)); }
  arma::vec vec() const { return f_; }

  friend class FeatureList;
};

class FeatureList : public std::vector<Feature>
{
public:
  void save(const std::string& fileName);
  void load(const std::string& fileName);
  static void FAST_features(const cv::Mat& inputImage, FeatureList& f_list, int threshold = 50);
  void mark(cv::Mat& M, cv::Scalar color = cv::Scalar(0, 255, 0));
};


#endif /* IMAGE_FEATURE_H_ */
